﻿using InnoWeb.CEND.Core.Model.Page;
using InnoWeb.CEND.Data.Mapping.BaseMapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InnoWeb.CEND.Data.Mapping.Page
{
    public class PageContentMapping : BaseMappingConfiguration<PageContent, int>
    {
        public PageContentMapping()
        {
            this.Property(a => a.Text).IsRequired().HasMaxLength(300);
            this.Property(a => a.TextTR).IsRequired().HasMaxLength(300);
            this.Property(a => a.VideoUrl).IsOptional();
            this.Property(a => a.Tags).IsRequired().HasMaxLength(100);

            this.Property(a => a.PageItemId);
            this.HasRequired(a => a.PageItem).WithMany(a => a.PageContents).HasForeignKey(a => a.PageItemId);

        }
    }
}
